package com.atguigu.myrule;

import com.netflix.loadbalancer.IRule;
import com.netflix.loadbalancer.RandomRule;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author 赵雨强
 * @create 2021/8/4 8:06
 * @description 自定义ribbon负载均衡的方式，不能放在springboot能够扫描的包下面
 */
@Configuration
public class MySelfRule {

    @Bean
    public IRule myRule(){
        // 随机访问
        return new RandomRule();
    }
}
